package com.lson.test.controller;

import com.alibaba.fastjson.JSON;
import com.lson.common.ResultMsg;
import com.lson.test.dto.ParamDto;
import com.lson.service.ClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("feign")
public class FeignController {
    @Autowired
    ClientService clientService;

    @RequestMapping("/test")
    public ResultMsg test(String str){
        System.out.println(str);
        ResultMsg success = clientService.success(str);
        return success;

    }

    @PostMapping("/post")
    public ResultMsg post(@RequestBody ParamDto paramDto){
        System.out.println(JSON.toJSONString(paramDto));
        ResultMsg resultMsg = clientService.post(paramDto);
        return resultMsg;
    }

}
